package com.hhit.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hhit.pojo.Shenfen;
import com.hhit.service.PrivService;




@Controller
@RequestMapping("/priv")
public class PrivController {

	@Resource
	private PrivService privService;

	@RequestMapping("/mod")
	public String modifyPriv(String identify, Integer[] privIds) {
		privService.modifyPriv(identify, privIds);

		return "priv/priv";
	}

	@RequestMapping("/getPrivsByIden")
	@ResponseBody
	public List<Integer> getPrivsByIden(@RequestBody Shenfen si) {
		List<Integer> pIdList = privService.getPrivs(si.getIdentify());
		return pIdList;
	}
}
